package com.ytjj.qmyx.admin.mapper;

import com.ytjj.qmyx.admin.model.ImSessionInfo;
import com.ytjj.qmyx.admin.model.ImSessionInfoExample;

import java.util.List;

import com.ytjj.qmyx.admin.model.dto.AdminDto;
import com.ytjj.qmyx.admin.model.dto.ImSessionInfoDto;
import com.ytjj.qmyx.admin.model.request.im.ImMonitorListRequest;
import com.ytjj.qmyx.admin.model.request.im.ImRealTimeServiceDateListRequest;
import com.ytjj.qmyx.admin.model.request.im.ImWorkReportListRequest;
import com.ytjj.qmyx.admin.model.response.im.ImMonitorListItemResponse;
import com.ytjj.qmyx.admin.model.response.im.ImRealTimeServiceDateListResponse;
import com.ytjj.qmyx.admin.model.response.im.ImSessionConnectTotalResponse;
import com.ytjj.qmyx.admin.model.response.im.ImWorkReportListResponse;
import com.ytjj.qmyx.admin.model.vo.ImSessionInfoVO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

public interface ImSessionInfoMapper {
    long countByExample(ImSessionInfoExample example);

    int deleteByExample(ImSessionInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(ImSessionInfo record);

    int insertSelective(ImSessionInfo record);

    List<ImSessionInfo> selectByExample(ImSessionInfoExample example);

    ImSessionInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") ImSessionInfo record, @Param("example") ImSessionInfoExample example);

    int updateByExample(@Param("record") ImSessionInfo record, @Param("example") ImSessionInfoExample example);

    int updateByPrimaryKeySelective(ImSessionInfo record);

    int updateByPrimaryKey(ImSessionInfo record);

    List<ImSessionInfoDto> selectByServiceId(@Param("serviceId") String serviceId, @Param("status") Integer status, @Param("customerIds")List<String> customerIds);

    List<ImSessionInfoDto> getAccessRecord(@Param("customerId") String customerId);

//    List<ImSessionInfoDto> getAllAccessRecord(@Param("imSessionInfoVO") ImSessionInfoVO imSessionInfoVO);

    int updateSatisfaction(@Param("id") Integer id, @Param("satisfaction") Byte satisfaction);

    List<ImSessionInfoDto> getAllAccessRecord(ImSessionInfoVO request);

//    List<ImSessionInfoDto> getAllAccessRecord(@Param("id") Integer id, @Param("serviceId") String serviceId, @Param("channel") String channel);

    List<ImMonitorListItemResponse> queryMonitorSessionList(ImMonitorListRequest request);

    Integer queryMeetingSessionNum(@Param("status") Integer status);


    String selectByName(@Param("serviceName") String serviceName);

    List<AdminDto> selectName();

    //查询在线客服
    List<AdminDto> selectOnlineName();

    List<ImRealTimeServiceDateListResponse> realTimeServiceData(ImRealTimeServiceDateListRequest request);

    List<ImWorkReportListResponse> workReport(ImWorkReportListRequest request);

    List<ImSessionInfoDto> allSessionByGroup(@Param("serviceId") String serviceId);

    List<ImSessionInfoDto> selectCustomerSessionOrderByCreateTime(@Param("customerId")String customerId);

    List<ImSessionInfoDto> selectAllByServiceId(@Param("serviceId")String serviceId);


    void updateQuestionTypeBySessionId(@Param("id") Integer sessionId, @Param("questionType") Byte questionType);

    List<Integer> selectIdsByCustomerId(@Param("customerId") String customerId);

    //客服当前连接人数
    List<ImSessionConnectTotalResponse> selectServiceConnectTotal();

    //客服累计连接人数
    List<ImSessionConnectTotalResponse> selectServiceHistoryTotal();
    //客服累计连接人数(只统计有聊天记录的)
    List<Integer> selectEveryServiceSessionNum(@Param("serviceId") String serviceId);

    List<ImSessionInfoDto> selectSessionByUserId(@Param("userId") String userId);

    int updateSessionByCustomerId(@Param("customerId")String customerId,@Param("serviceId") String serviceId);

    int findToDayCount();

    String findServiceInviteRate(@Param("serviceId") String serviceId);

    String findServiceScoreRate(@Param("serviceId") String serviceId);
}